Optimal. Leaf size=129 \[ \frac {i (e+f x)^2}{a d}+\frac {(e+f x)^3}{3 a f}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}+\frac {4 i f^2 \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 8, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {4611, 32, 3399,
4269, 3798, 2221, 2317, 2438} \begin {gather*} \frac {4 i f^2 \text {PolyLog}\left (2,i e^{i (c+d x)}\right )}{a d^3}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right )}{a d}+\frac {i (e+f x)^2}{a d}+\frac {(e+f x)^3}{3 a f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 32
Rule 2221
Rule 2317
Rule 2438
Rule 3399
Rule 3798
Rule 4269
Rule 4611
Rubi steps
\begin {align*} \int \frac {(e+f x)^2 \sin (c+d x)}{a+a \sin (c+d x)} \, dx &=\frac {\int (e+f x)^2 \, dx}{a}-\int \frac {(e+f x)^2}{a+a \sin (c+d x)} \, dx\\ &=\frac {(e+f x)^3}{3 a f}-\frac {\int (e+f x)^2 \csc ^2\left (\frac {1}{2} \left (c+\frac {\pi }{2}\right )+\frac {d x}{2}\right ) \, dx}{2 a}\\ &=\frac {(e+f x)^3}{3 a f}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {(2 f) \int (e+f x) \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \, dx}{a d}\\ &=\frac {i (e+f x)^2}{a d}+\frac {(e+f x)^3}{3 a f}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {(4 f) \int \frac {e^{2 i \left (\frac {c}{2}+\frac {d x}{2}\right )} (e+f x)}{1-i e^{2 i \left (\frac {c}{2}+\frac {d x}{2}\right )}} \, dx}{a d}\\ &=\frac {i (e+f x)^2}{a d}+\frac {(e+f x)^3}{3 a f}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}+\frac {\left (4 f^2\right ) \int \log \left (1-i e^{2 i \left (\frac {c}{2}+\frac {d x}{2}\right )}\right ) \, dx}{a d^2}\\ &=\frac {i (e+f x)^2}{a d}+\frac {(e+f x)^3}{3 a f}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}-\frac {\left (4 i f^2\right ) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{2 i \left (\frac {c}{2}+\frac {d x}{2}\right )}\right )}{a d^3}\\ &=\frac {i (e+f x)^2}{a d}+\frac {(e+f x)^3}{3 a f}+\frac {(e+f x)^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {4 f (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d^2}+\frac {4 i f^2 \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.99, size = 181, normalized size = 1.40 \begin {gather*} \frac {x \left (3 e^2+3 e f x+f^2 x^2\right )+\frac {6 i f \left (2 i d (e+f x) \log (1-i \cos (c+d x)+\sin (c+d x))+2 f \text {Li}_2(i \cos (c+d x)-\sin (c+d x))+\frac {d^2 x (2 e+f x) (\cos (c)+i \sin (c))}{\cos (c)+i (1+\sin (c))}\right )}{d^3}-\frac {6 (e+f x)^2 \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}}{3 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 292 vs. \(2 (113 ) = 226\).
time = 0.11, size = 293, normalized size = 2.27
method | result | size |
risch | \(\frac {f^{2} x^{3}}{3 a}+\frac {f e \,x^{2}}{a}+\frac {e^{2} x}{a}+\frac {e^{3}}{3 a f}+\frac {2 x^{2} f^{2}+4 e f x +2 e^{2}}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}-\frac {4 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) e}{a \,d^{2}}+\frac {4 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right ) e}{a \,d^{2}}+\frac {2 i f^{2} x^{2}}{a d}+\frac {4 i f^{2} c x}{a \,d^{2}}+\frac {2 i f^{2} c^{2}}{a \,d^{3}}-\frac {4 f^{2} \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) x}{a \,d^{2}}-\frac {4 f^{2} \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) c}{a \,d^{3}}+\frac {4 i f^{2} \polylog \left (2, i {\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{3}}+\frac {4 f^{2} c \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a \,d^{3}}-\frac {4 f^{2} c \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{3}}\) | \(293\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 409 vs. \(2 (112) = 224\).
time = 0.60, size = 409, normalized size = 3.17 \begin {gather*} \frac {d^{3} f^{2} x^{3} + 3 \, d^{3} f x^{2} e + 3 \, d^{3} x e^{2} - 6 i \, d^{2} e^{2} - 12 \, {\left (d f \cos \left (d x + c\right ) e + i \, d f e \sin \left (d x + c\right ) + i \, d f e\right )} \arctan \left (\sin \left (d x + c\right ) + 1, \cos \left (d x + c\right )\right ) + 12 \, {\left (d f^{2} x \cos \left (d x + c\right ) + i \, d f^{2} x \sin \left (d x + c\right ) + i \, d f^{2} x\right )} \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) - {\left (i \, d^{3} f^{2} x^{3} - 3 \, {\left (-i \, d^{3} f e + 2 \, d^{2} f^{2}\right )} x^{2} - 3 \, {\left (-i \, d^{3} e^{2} + 4 \, d^{2} f e\right )} x\right )} \cos \left (d x + c\right ) + 12 \, {\left (f^{2} \cos \left (d x + c\right ) + i \, f^{2} \sin \left (d x + c\right ) + i \, f^{2}\right )} {\rm Li}_2\left (i \, e^{\left (i \, d x + i \, c\right )}\right ) - 6 \, {\left (d f^{2} x + d f e - {\left (i \, d f^{2} x + i \, d f e\right )} \cos \left (d x + c\right ) + {\left (d f^{2} x + d f e\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right ) + {\left (d^{3} f^{2} x^{3} + 3 \, {\left (d^{3} f e + 2 i \, d^{2} f^{2}\right )} x^{2} + 3 \, {\left (d^{3} e^{2} + 4 i \, d^{2} f e\right )} x\right )} \sin \left (d x + c\right )}{-3 i \, a d^{3} \cos \left (d x + c\right ) + 3 \, a d^{3} \sin \left (d x + c\right ) + 3 \, a d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 587 vs. \(2 (112) = 224\).
time = 0.39, size = 587, normalized size = 4.55 \begin {gather*} \frac {d^{3} f^{2} x^{3} + 3 \, d^{2} f^{2} x^{2} + {\left (d^{3} f^{2} x^{3} + 3 \, d^{2} f^{2} x^{2} + 3 \, {\left (d^{3} x + d^{2}\right )} e^{2} + 3 \, {\left (d^{3} f x^{2} + 2 \, d^{2} f x\right )} e\right )} \cos \left (d x + c\right ) - 6 \, {\left (-i \, f^{2} \cos \left (d x + c\right ) - i \, f^{2} \sin \left (d x + c\right ) - i \, f^{2}\right )} {\rm Li}_2\left (i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) - 6 \, {\left (i \, f^{2} \cos \left (d x + c\right ) + i \, f^{2} \sin \left (d x + c\right ) + i \, f^{2}\right )} {\rm Li}_2\left (-i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) + 3 \, {\left (d^{3} x + d^{2}\right )} e^{2} + 3 \, {\left (d^{3} f x^{2} + 2 \, d^{2} f x\right )} e + 6 \, {\left (c f^{2} - d f e + {\left (c f^{2} - d f e\right )} \cos \left (d x + c\right ) + {\left (c f^{2} - d f e\right )} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right ) - 6 \, {\left (d f^{2} x + c f^{2} + {\left (d f^{2} x + c f^{2}\right )} \cos \left (d x + c\right ) + {\left (d f^{2} x + c f^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) - 6 \, {\left (d f^{2} x + c f^{2} + {\left (d f^{2} x + c f^{2}\right )} \cos \left (d x + c\right ) + {\left (d f^{2} x + c f^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (-i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) + 6 \, {\left (c f^{2} - d f e + {\left (c f^{2} - d f e\right )} \cos \left (d x + c\right ) + {\left (c f^{2} - d f e\right )} \sin \left (d x + c\right )\right )} \log \left (-\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right ) + {\left (d^{3} f^{2} x^{3} - 3 \, d^{2} f^{2} x^{2} + 3 \, {\left (d^{3} x - d^{2}\right )} e^{2} + 3 \, {\left (d^{3} f x^{2} - 2 \, d^{2} f x\right )} e\right )} \sin \left (d x + c\right )}{3 \, {\left (a d^{3} \cos \left (d x + c\right ) + a d^{3} \sin \left (d x + c\right ) + a d^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {e^{2} \sin {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {f^{2} x^{2} \sin {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {2 e f x \sin {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sin \left (c+d\,x\right )\,{\left (e+f\,x\right )}^2}{a+a\,\sin \left (c+d\,x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________